package com.example.springboot;

import com.example.springboot.filter.CustomGlobalFilter;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Service;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.context.annotation.Bean;

@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class,
        DataSourceTransactionManagerAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class})
@EnableDubbo
@Service
public class YApiGatewayApplication {


    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(YApiGatewayApplication.class, args);
        YApiGatewayApplication application = context.getBean(YApiGatewayApplication.class);

    }

    @Bean
    public GlobalFilter customFilter() {
        return new CustomGlobalFilter();
    }

}
